#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

#define M 10

bool isPalindrome(int x) {
        if(x<0)
            return false;
        if(x == 0)
            return true;
        if(x/10 == 0)
            return true;
        int temp,weishu=1;
        int front,end;
        temp = x;
        while((x = x/10))
        {
            weishu++;
        }
        x = temp;
        for (int i = 0; i < weishu/2;i++)
        {
            int shi = 1;
            temp = weishu;
            while(weishu - 1)
            {
                shi *= 10;
                weishu--;
            }

            if((front = (x/shi)) != (end = x%10))
            {
                return false;
            }
            x = x - front*shi;
            x = x/10;
            weishu = temp - 2;
        }
        return true;
}

int main()
{
    bool a;
    int input;

    scanf("%d", &input);
    a = isPalindrome(input);

    cout<<a<<endl;


    return 0;
}
